#ifndef __SYS_IMPL_H__
#define __SYS_IMPL_H__

//#include "includes.h"

#include "list.h"
#include "tr_media_defines.h"
#include "tr_media_common.h"
#include "tr_media_vpss.h"

#ifdef __cplusplus
extern "C"{
#endif


/*
陈宇:
support_stride
readonly_access
private_buf

是否支持stride
是否会改变原数据
是否下家提供buf
*/

struct mod_param
{
    unsigned char use_internal_mem;//use owner buffer 
    unsigned char read_only;//buffer read_only
    unsigned char has_stride;//can recieve stride frame
};

#if 0

#if 0
typedef struct trMPP_CHN_S
{
    MOD_ID_E enModId;
    int32_t s32DevId;
    int32_t s32ChnId;
} MPP_CHN_S;
#endif

typedef struct trMEDIA_CHANNEL_S
{
    MPP_CHN_S stBaseInfo;

    MOD_ID_E enModId;
    int32_t s32DevId;
    int32_t s32ChnId;

    BOOL bEnable;
    BOOL bBind;

    //MPP_CHN_S

    //info: frameInfo;
    //w,h,fps,...

    void *reversePtr;

    void *priv;
} MEDIA_CHANNEL_S;

typedef struct trVDEC_IMPL_S
{
    MOD_ID_E enModId;
    int32_t s32DevId;

    MEDIA_CHANNEL_S stInChannels[64];
    MEDIA_CHANNEL_S stOutChannels[64];

    void *priv;
} VDEC_IMPL_S;
#endif

/*
#define MPP_SINK_MAX_NUM 32
typedef struct stModBindData {
    int src_valid_count;
    int sink_valid_count;
    MPP_CHN_S chn_src;
    MPP_CHN_S chn_sink[MPP_SINK_MAX_NUM];
} ModBindData;
*/


typedef struct stPIN_S
{
    BOOL bConnect;
    MPP_CHN_S stInfo;
} PIN_S;

typedef struct stPIN_DATA_S
{
    PIN_S *pstInPins;
    PIN_S *pstOutPins;
    int32_t s32InPinMaxNum;
    int32_t s32OutPinMaxNum;
} PIN_DATA_S;

#define MOD_CHN_MAX_NUM 64
#define MOD_NAME_MAX_LEN 32

typedef struct stMPP_CHANNEL_IMG_INFO 
{
    uint32_t u32Width;
    uint32_t u32Height;
    PIXEL_FORMAT_E enPixelFormat;
    VPSS_FRAME_RATE_S stFrameRate;
} MPP_CHANNEL_IMG_INFO_S;

int32_t HI_MPI_SYS_PIN_DATA_Init_I(PIN_DATA_S *pstPinDat, int32_t s32MaxInput, int32_t s32MaxOutput);
int32_t HI_MPI_SYS_PIN_DATA_DeInit_I(PIN_DATA_S *pstPinDat);

int32_t HI_MPI_SYS_Get_Channel_Image_Info(MPP_CHN_S *pstChn, MPP_CHANNEL_IMG_INFO_S *pstImgInfo);

#ifdef __cplusplus
}
#endif

#endif